import {NgModule} from '@angular/core';
import {RouterModule, Routes} from '@angular/router';
import {LoginComponent} from '../../components/login/login.component';
import {MainComponent} from '../../components/main/main.component';
import {AuthGuardService} from '../../services/route/auth-guard.service';
import {PlatformInfoComponent} from '../../components/main/content/platform-info/platform-info.component';
import {UserManagerComponent} from '../../components/main/content/user-manager/user-manager.component';
import {ChargeManagerComponent} from '../../components/main/content/charge-manager/charge-manager.component';
import {ChargeRecordComponent} from '../../components/main/content/charge-record/charge-record.component';
import {MoneyManagerComponent} from '../../components/main/content/money-manager/money-manager.component';
import {MoneyRecordComponent} from '../../components/main/content/money-record/money-record.component';
import {SystemSetComponent} from '../../components/main/content/system-set/system-set.component';
import {GameGroupComponent} from '../../components/main/content/game-group/game-group.component';
import {RobotGroupComponent} from '../../components/main/content/robot-group/robot-group.component';
import {RobotManagerComponent} from '../../components/main/content/robot-manager/robot-manager.component';
import {RobotGroupListComponent} from '../../components/main/content/robot-group-list/robot-group-list.component';
import {PersonalGroupComponent} from '../../components/main/content/personal-group/personal-group.component';
import {GameGroupEditComponent} from '../../components/main/content/game-group-edit/game-group-edit.component';
import {PlatformStatisticComponent} from '../../components/main/content/platform-statistic/platform-statistic.component';
import {PersonalGroupDetailComponent} from '../../components/main/content/personal-group-detail/personal-group-detail.component';
import {ChargeStyleComponent} from '../../components/main/content/charge-style/charge-style.component';


const routes: Routes = [
  {path: 'login', component: LoginComponent},
  {
    path: 'main', component: MainComponent, children: [
      {
        path: 'oplatform', children: [
          {path: 'system', component: PlatformInfoComponent},
          {path: 'system-set', component: SystemSetComponent},
          {path: 'user', component: UserManagerComponent},
          {path: 'charge', component: ChargeManagerComponent},
          {path: 'charge-log', component: ChargeRecordComponent},
          {path: 'money', component: MoneyManagerComponent},
          {path: 'money-log', component: MoneyRecordComponent},
          {path: 'game-group', component: GameGroupComponent},
          {path: 'personal-group', component: PersonalGroupComponent},
          {path: 'personal-group-detail', component: PersonalGroupDetailComponent},
          {path: 'robot-group', component: RobotGroupComponent},
          {path: 'robot-group-list', component: RobotGroupListComponent},
          {path: 'game-group-config', component: GameGroupEditComponent},
          {path: 'robot-manager', component: RobotManagerComponent},
          {path: 'platform-statistic', component: PlatformStatisticComponent},
          {path: 'charge-style', component: ChargeStyleComponent},
          {path: '**', pathMatch: 'full', redirectTo: 'system'}
        ],
      },
    ],
    canActivate: [AuthGuardService]
  },
];

@NgModule({
  exports: [RouterModule],
  imports: [RouterModule.forRoot(routes)],
})
export class RoutesModule {
}
